package cn.witsky.rtp2ws.exception;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.lmax.disruptor.ExceptionHandler;

import cn.witsky.rtp2ws.Rtp2WsApplication;
import cn.witsky.rtp2ws.domain.Message;

public class IntEventExceptionHandler implements ExceptionHandler<Message> {
	private static Logger logger = LoggerFactory.getLogger(Rtp2WsApplication.class);
    public void handleEventException(Throwable ex, long sequence, Message event) {
    	String taskId="";
    	if(event.isCaller()) {
    		taskId=event.getCallId()+"-calller";
    	}else {
    		taskId=event.getCallId()+"-callled";
    	}
    	logger.error("task:"+taskId+" handleEventException", ex);
    }

    public void handleOnStartException(Throwable ex) {
    	logger.error("handleOnStartException", ex);
    }

    public void handleOnShutdownException(Throwable ex) {
    	logger.error("handleOnShutdownException", ex);
    }
}
